package com.doit.day05

object _01_迭代器上的算子 {
  def main(args: Array[String]): Unit = {

    val list: List[Int] = List(1, 2, 3, 4, 5)
/*
    val list1: List[Int] = list.map(a => {
      println("hehe")
      a * 10
    })*/

    val it: Iterator[Int] = list.iterator


    //spark 里面的rdd
    val ints: Iterator[Int] = it.map(a => {
      println("heihei")
      a * 10
    })


    val ints1: Iterator[Int] = ints.map(a => {
      a * 20
    })

    val ints2: Iterator[Int] = ints1.map(_ * 1)


    ints2.foreach(println)




  }
}
